package com.pai4j.pgc.service.relation;


import com.pai4j.common.bean.PAIPageResponseBeanUtil;
import com.pai4j.domain.vo.response.UserBaseResponseInfoVO;

import java.util.Set;

public interface SubjectRelationWrapper {

    /**
     * 订阅/关注
     *
     * @param userId
     * @param subjectId
     * @return
     */
    Boolean subscribe(String userId, Long subjectId);

    /**
     * 取消订阅/关注
     *
     * @param userId
     * @param subjectId
     * @return
     */
    Boolean unsubscribe(String userId, Long subjectId);

    /**
     * 查询账号关系数据
     * 注：走redis
     *
     * @param subjectId
     * @param pageNo
     * @param pageSize
     * @return
     */
    PAIPageResponseBeanUtil<UserBaseResponseInfoVO> listRelations(Long subjectId, Integer pageNo, Integer pageSize);

    /**
     * 查询订阅了当前专题的所有账号
     * @param subjectId
     * @return
     */
    Set<String> getAllSubscriber(Long subjectId);

    /**
     * 判断用户是否订阅某个专题
     *
     * @param userId
     * @param subjectId
     * @return
     */
    boolean isSubscribe(String userId, Long subjectId);
}
